package com.study.ibatis.io.session;

import com.study.ibatis.io.cfg.Configuration;

import java.io.InputStream;

/**
 * 用于创建一个SqlSessionFactory对象
 */
public class SqlSessionFactoryBuilder {
    /**
     * 根据配置文件输入流
     * @param is
     * @return
     */
    public SqlSessionFactory build(InputStream is) {
        Configuration configuration=com.study.utils.XMLConfigBuilder.loadConfiguration(is);
        return new DefaultSqlSessionFactory(configuration);
    }
}
